package com.dongdongshop.service.impl;

import com.dongdongshop.mapper.TbTypeTemplateMapper;
import com.dongdongshop.pojo.TbTypeTemplate;
import com.dongdongshop.service.TbtypeService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

//模板管理
@DubboService
@Service
public class TbtypeServiceimpl  implements TbtypeService {



    @Autowired
    TbTypeTemplateMapper ttm;


    //查询所有
    @Override
    public List<TbTypeTemplate> getall() {
        return ttm.selectByExample(null);
    }

    //增加
    @Override
    public int addspec(TbTypeTemplate tt) {
        return ttm.insertSelective(tt);
    }


    //修改回显
    @Override
    public TbTypeTemplate upbyid(Long id) {
        return ttm.selectByPrimaryKey(id);
    }

    //修改
    @Override
    public int uptype(TbTypeTemplate tt) {
        return ttm.updateByPrimaryKey(tt);
    }

    //删除
    @Override
    public int deleteid(Long id) {
        return ttm.deleteByPrimaryKey(id);
    }
    //根据主键查询一条记录
    @Override
    public TbTypeTemplate gettypeid(Long id) {
        return ttm.selectByPrimaryKey(id);
    }
}
